home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iihd.asp < prev    next >
Encoding:
Text File  |  1999-06-03  |  19.7 KB  |  807 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% 'Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <% 
  6.  
  7.     ' This script is the main container for the admin..
  8.     ' It holds the client-cached tree list, stored in cachedList
  9.     ' in addition to a variety of global functions & customization
  10.     ' flags. This script gets loaded once for the admin and is
  11.     ' persistant throughout.
  12.  
  13. '$
  14. Const STR_SUPPORT_MULTI_SELECT = "hasDHTML"
  15.  
  16. %>
  17. <!--#include file="iihd.str"-->
  18. <!--#include file="iisetfnt.inc"-->
  19.  
  20. <!--#include file="iiaspstr.inc"-->
  21.  
  22. <html>
  23. <head>
  24. <title><%= L_ISM_TEXT %></title>
  25.  
  26. <script language="JavaScript">
  27.  
  28.     // Create an instance of our Global Variables for reference by other frames...
  29.     Global=new globalVars();
  30.     
  31.     // Create the nodeList array
  32.     nodeList=new Array();
  33.     nodeList[0]="";
  34.  
  35.     <!--#include file="iijsfuncs.inc"-->
  36.     function unload_popwindow()
  37.     {
  38.         if(Global.popwindow != null)
  39.             Global.popwindow.close();
  40.     }
  41.  
  42.     function helpBox()
  43.     {
  44.         if (Global.helpFileName==null)
  45.         {
  46.             alert("<%= L_NOHELP_ERRORMESSAGE %>");
  47.         }
  48.         else
  49.         {
  50.             helpfile = Global.helpDir + Global.helpFileName+".htm";
  51.             thefile="iihelp.asp?pg=" + helpfile;
  52.             <% if Session("hasDHTML") then %>
  53.                 window.showHelp("http://" + helpfile);
  54.             <% else %>
  55.  
  56.             window.open(thefile ,"Help","toolbar=no,scrollbars=yes,directories=no,menubar=yes,width=375,height=500");
  57.             <% end if %>
  58.         }
  59.     }
  60.  
  61.     function aboutBox() {
  62.         popbox=window.open("iiabout.asp","about","toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+525+",height="+300);
  63.         if(popbox !=null){
  64.             if (popbox.opener==null){
  65.                 popbox.opener=self;
  66.             }
  67.         }
  68.  
  69.     }
  70.  
  71.     function globalVars(){
  72.  
  73.         // Sets the global variables for the script. 
  74.         // These may be changed to quickly customize the tree's apperance
  75.  
  76.         // Fonts
  77.         this.face="Helv,Arial";
  78.         this.fSize=1;
  79.  
  80.         // Spacing
  81.         this.vSpace=2;
  82.         this.hSpace=4;
  83.         this.tblWidth=500;
  84.         this.selTColor="#FFCC00";
  85.         this.selFColor="#000000";
  86.         this.selUColor="<%= Session("BGCOLOR") %>";
  87.  
  88.         // Images
  89.         this.imagedir="images/";
  90.         this.appIcon = "app";        
  91.         this.spaceImg=this.imagedir  + "space.gif";
  92.         this.lineImg=this.imagedir  + "line.gif";
  93.         this.plusImg=this.imagedir  + "plus.gif";
  94.         this.minusImg=this.imagedir  + "minus.gif";
  95.         this.emptyImg=this.imagedir + "blank.gif";
  96.         this.plusImgLast=this.imagedir  + "plusl.gif";
  97.         this.minusImgLast=this.imagedir  + "minusl.gif";
  98.         this.emptyImgLast=this.imagedir + "blankl.gif";
  99.         this.stateImg=new Array();
  100.         this.stateImg[0]=this.imagedir + "stop.gif";
  101.         this.stateImg[1]=this.imagedir + "go.gif";
  102.         this.stateImg[2]=this.imagedir + "pause.gif";
  103.  
  104.         // Instant State
  105.         this.displaystate=new Array();
  106.         this.displaystate[0]="";
  107.         this.displaystate[2]="";        
  108.         this.displaystate[4]="<%= L_STOPPEDDISP_TEXT %>";        
  109.         this.displaystate[6]="<%= L_PAUSEDDISP_TEXT %>";
  110.         
  111.         this.state=new Array();
  112.         this.state[4]="<%= L_STOPPED_TEXT %>";
  113.         this.state[2]="<%= L_STARTED_TEXT %>";
  114.         this.state[1]="<%= L_STARTING_TEXT %>";
  115.         this.state[3]="<%= L_STOPPING_TEXT %>";        
  116.  
  117.         // ID of selected item
  118.         this.selId=0;
  119.         this.selName="";
  120.         this.selSType="";
  121.         this.selVType="";
  122.         
  123.         //$ Multi-select
  124.         this.selCount = 1;
  125.         <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  126.         this.bSupportMultiSelect = true;
  127.         this.selList = new Array();
  128.         this.selList[0] = 0;
  129.         <% else    %>
  130.         this.bSupportMultiSelect = false;
  131.         <% end if %>
  132.         
  133.         //Help
  134.         this.helpFileName="iipxmain.htm";
  135.         this.helpDir="<%= Request.ServerVariables("SERVER_NAME") %>/iishelp/iis/htm/core/"
  136.         
  137.  
  138.         // Other Flags
  139.         this.showState=false;    
  140.         this.dontAsk=false;
  141.         this.updated=false;
  142.         this.homeurl=top.location.href;
  143.         this.siteProperties = false;
  144.         this.working = false;
  145.         
  146.         //Global var to hold the window object, so we can refer to the current window from a parent frame.    
  147.         this.popwindow = null;
  148.     }
  149.     
  150.     function nodeListInterfaceDef()
  151.     {
  152.         this.selectItem = selectItem;
  153.     <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  154.         this.selectMulti = selectMulti;
  155.     <% end if %>
  156.     }
  157.     var nodeListInterface = new nodeListInterfaceDef();
  158.  
  159. <% if Session(STR_SUPPORT_MULTI_SELECT) then %>
  160.     function selectMulti( index )
  161.     {
  162.         if( nodeList[index].selected == true )
  163.         {
  164.             selectRemove( index );
  165.         }
  166.         else
  167.         {
  168.             selectAdd( index );
  169.         }
  170.         Global.selId = Global.selList[0];
  171.     }
  172.     
  173.     function selectAdd( index )
  174.     {
  175.         nodeList[index].selected = true;
  176.         Global.selList[Global.selCount++] = index;
  177.     }
  178.     
  179.     function selectRemove( index )
  180.     {
  181.         if( Global.selCount > 0 )
  182.         {
  183.             var i, j;
  184.             for( i = 0; i < Global.selCount; i++ )
  185.             {
  186.                 if( Global.selList[i] == index )
  187.                 {
  188.                     break;
  189.                 }
  190.             }
  191.             if( i < Global.selCount )
  192.             {
  193.                 nodeList[Global.selList[i]].selected = false;
  194.                 for( j = i + 1; j < Global.selCount; j++ )
  195.                 {
  196.                     Global.selList[j-1] = Global.selList[j];
  197.                 }
  198.                 Global.selCount--;
  199.             }
  200.         }
  201.     }
  202.     
  203.     function selectItem( item )
  204.     {
  205.         // Deselect all currently selected items
  206.         for( var i = 0; i < Global.selCount; i++ )
  207.         {
  208.             nodeList[Global.selList[i]].selected = false;
  209.         }
  210.         
  211.         // Select the new item
  212.         nodeList[item].selected = true;
  213.         Global.selId = Global.selList[0] = item;
  214.         Global.selCount = 1;
  215.     }
  216. <% else    %>
  217.     function selectItem(item)
  218.     {
  219.         nodeList[Global.selId].selected=false;
  220.         Global.selId=item;
  221.         nodeList[item].selected=true;
  222.     }
  223. <% end if %>
  224.  
  225.     function openLocation(){
  226.     
  227.         //opens the property sheet for the selected node,
  228.         //regardless of service type or node type. this
  229.         //script calls iiset.asp which sets the appropriate
  230.         //session variables for server side persistance throughout
  231.         //the property sheet
  232.                 
  233.         var path;
  234.         var sel=Global.selId;
  235.         Global.selName=nodeList[sel].title;
  236.         Global.selSType=nodeList[sel].stype;
  237.         Global.selVType=nodeList[sel].vtype;
  238.  
  239.         top.body.iisstatus.location.href=("iistat.asp?thisState=Loading");
  240.  
  241.         path="stype=" + Global.selSType;
  242.         path=path + "&vtype=" + Global.selVType;
  243.         path=path + "&title=" +escape(nodeList[sel].title);
  244.  
  245.         if (nodeList[sel].vtype=="server"){
  246.             path=path + "&spath=" + escape(nodeList[sel].path);
  247.             path=path + "&dpath=" + escape(nodeList[sel].path) + "/Root";
  248.         }
  249.         else{
  250.             path=path + "&spath=";        
  251.             path=path + "&dpath=" + escape(nodeList[sel].path);            
  252.         }
  253.  
  254.         page="iiset.asp?"+path; 
  255.         
  256.         //iiset.asp sets the serverside session variables...
  257.         
  258.         top.connect.location.href=(page);    
  259.     }
  260.  
  261.  
  262.     function sortOrder(a,b){
  263.  
  264.         x=a.id - b.id
  265.  
  266.         return x
  267.     }
  268.     
  269.     function sortList(){
  270.         nodeList.sort(sortOrder);
  271.     }
  272.  
  273.     function insertNode(title,caption,parent,vtype,stype, fIsApp){
  274.  
  275.         //add a new node to the client-cached list
  276.         
  277.         var nodepath;
  278.         var indexnum=nodeList.length;
  279.         var Nextid=parent+1;
  280.  
  281.         // Clear the current selection before we start monkeying with
  282.         // the list.
  283.         selectItem( 0 );
  284.         
  285.         if (nodeList[parent].vtype=="server"){
  286.             nodepath=nodeList[parent].path + "/Root/" + title;            
  287.         }
  288.         else{
  289.             if (nodeList[parent].vtype=="comp"){
  290.                 if (stype == "www"){
  291.                     nodepath=nodeList[parent].path + "/W3SVC/" + title;
  292.                 }
  293.                 else{
  294.                     nodepath=nodeList[parent].path + "/MSFTPSVC/" + title;                    
  295.                 }
  296.             }
  297.             else{
  298.                 nodepath=nodeList[parent].path + "/" + title;
  299.             }
  300.         }
  301.         title=title;
  302.  
  303.         while ((nodeList.length > Nextid) && (nodeList[Nextid].parent >=parent)) {
  304.             if(nodeList[Nextid].parent==parent){
  305.                 if(nodeList[Nextid].title > title){
  306.                     break;
  307.                 }
  308.             }
  309.             Nextid=Nextid +1;
  310.         }
  311.  
  312.         if (nodeList.length <=Nextid){
  313.             var newid=nodeList.length;
  314.         }
  315.         else{
  316.             var newid=nodeList[Nextid].id;
  317.         }
  318.  
  319.         nodeList[indexnum]=nodeList[parent].addNode(new listObj(indexnum,caption,nodepath,vtype,4));
  320.         nodeList[indexnum].isCached=false;
  321.         nodeList[indexnum].id=newid;
  322.         if( fIsApp != 0 )
  323.         {
  324.             nodeList[indexnum].icon = Global.imagedir + "app";
  325.             nodeList[indexnum].isApp = true;
  326.         }
  327.         for (var i=newid; i < indexnum; i++) {
  328.             nodeList[i].id=nodeList[i].id + 1;        
  329.             if (nodeList[i].parent >=nodeList[indexnum].id){
  330.                 nodeList[i].parent=nodeList[i].parent +1;
  331.             }    
  332.         }
  333.  
  334.         nodeList[parent].open=true;
  335.         
  336.         nodeList[0].sortList();
  337.         nodeList[0].markTerms();
  338.              
  339.         
  340.         selectItem(newid);
  341.  
  342.         top.body.list.location.href="iisrvls.asp";
  343.     }
  344.     
  345.     function browseItem() {
  346.         popBox('Browse',640,480, nodeList[Global.selId].loc);
  347.     }
  348.  
  349.     function deleteItem() {
  350.             // marks items in the client cached list as deleted...
  351.             nodeList[Global.selId].deleted=true;
  352.             if (Global.selId+1 !=listLength){
  353.                 deleteChildren(Global.selId);
  354.             }
  355.             markTerms();
  356.             top.body.list.location="iisrvls.asp";
  357.     }
  358.  
  359.     function deleteChildren(item){
  360.         var z=item+1;
  361.         while (nodeList[z].parent >=item) {
  362.             nodeList[z].deleted=true;
  363.             z=z+1;
  364.             if(z >=nodeList.length){
  365.                 break;
  366.             }
  367.         }            
  368.     }
  369.  
  370.  
  371.     function deCache(){
  372.  
  373.         //marks a node as uncached (forcing a recache when expanded)
  374.         //and marks all child nodes as deleted
  375.  
  376.         sel=Global.selId;
  377.         nodeList[sel].isCached=false;
  378.         nodeList[sel].open=false;
  379.         if (sel+1 !=listLength){
  380.             deleteChildren(sel);
  381.         }
  382.         markTerms();
  383.     }
  384.  
  385.  
  386.     function markTerms(){
  387.     
  388.         //marks cached list items as being a terminater (ie, having no siblings)
  389.         //this forces an "end" gif in the tree view...
  390.         
  391.         var i
  392.         listLength=nodeList.length; 
  393.         for (i=0; i < listLength; i++) {
  394.             nodeList[i].lastChild=isLast(i);
  395.         }
  396.     }
  397.  
  398.     function isLast(item){
  399.         var i;
  400.         last=false;
  401.         if (item+1==listLength){
  402.             last=true;
  403.         }
  404.         else{
  405.             if (nodeList[item].parent==null){
  406.                 last=true;
  407.                 for (i=item+1; i < listLength; i++) {
  408.                     if (nodeList[i].parent==null){
  409.                         last=false;
  410.                         break;
  411.                     }
  412.                 }
  413.             }
  414.             else{
  415.                 last=true;
  416.                 var y=item+1;
  417.                 while(nodeList[y].parent >=nodeList[item].parent){
  418.                     if(nodeList[y].parent==nodeList[item].parent){
  419.                         if(!nodeList[y].deleted){
  420.                             last=false;
  421.                             break;
  422.                         }
  423.                     }
  424.     
  425.                     y=y+1;
  426.     
  427.                     if ((y)==listLength){
  428.                         break;
  429.                     }
  430.                 }
  431.             }
  432.         }
  433.         return last;
  434.     }
  435.  
  436.     function addNode(childNode){
  437.     
  438.         //adds a new node to the tree, setting some default parameters
  439.     
  440.         childNode.parent=this.id;
  441.         childNode.level=this.level +1;
  442.  
  443.         dir="images/"
  444.         if (childNode.vtype=="vdir"){
  445.             childNode.loc=nodeList[this.id].loc + childNode.title+"/";
  446.             childNode.icon=dir+ "vdir";
  447.         } 
  448.         else{
  449.             if (childNode.vtype=="dir"){
  450.                 childNode.loc=nodeList[this.id].loc + childNode.title+"/";
  451.                 childNode.icon=dir + "dir";
  452.             }
  453.             else{
  454.                 if (childNode.stype=="www"){    
  455.                     childNode.loc="http://"+childNode.title+"/";
  456.                     childNode.icon=dir +"www";
  457.                     
  458.                 }
  459.                 
  460.                 if (childNode.stype=="ftp"){
  461.                     childNode.loc="ftp://"+childNode.title+"/";
  462.                     childNode.icon=dir +"ftp";
  463.                 }
  464.             }
  465.         }
  466.  
  467.         return childNode;
  468.     }
  469.  
  470.     function connect(){
  471.         serverurl=prompt("Please enter the URL of the server you wish to connect to:", "http://<%= Request.ServerVariables("SERVER_NAME") %>/iisadmin/")
  472.         if (serverurl !=""){
  473.             page="iicnct.asp";
  474.             top.body.iisstatus.location="iistat.asp?thisState=Loading";
  475.             top.connect.location=page;
  476.         }
  477.     }
  478.  
  479.     function cache(item){
  480.         // perftest
  481.         // The two lines below call different tree caching scripts. To change between them
  482.         // simply uncomment one and comment out the other.
  483.  
  484. //        page="iicache.asp?sname="+escape(nodeList[item].path)+"&Nextid="+nodeList.length+"¤tid="+item;
  485.         page="iicache2.asp?sname=" + escape(nodeList[item].path) + "&fspath=" + escape(nodeList[item].fspath);
  486.  
  487.         <% if (browser<>"ns") then %>
  488.         top.body.iisstatus.location.href="iistat.asp?thisState=Loading";
  489.         <% end if %>
  490.         top.connect.location.href=page;
  491.     }
  492.     
  493.     function loadPage(){
  494.         top.body.location.href='iibody.asp';
  495.     }    
  496.     
  497.     
  498.     function inheritenceItem(property, path){
  499.         this.property = property;
  500.         this.path = path;
  501.     }
  502.     
  503.     function iListsortOrder(a,b){
  504.         x=((a.property + a.path) - (b.property + b.path));
  505.         return x
  506.     }
  507.     
  508.  
  509.     function listObj(id, title, path,vtype,state){
  510.  
  511.         // This is the object that represents each line item 
  512.         // In the tree structure.
  513.  
  514.         // ID is the id refered to by the parent property
  515.         // title is the text string that appears In the list
  516.         // parent is the ID of the parent list item
  517.         // level is the depth of the list item, 0 being the furthest left on the tree
  518.         // href is the location to open when selected
  519.         // open is a flag that determines whether children are displayed
  520.         // state is a flag to determine the state (4=stopped, 2=running)
  521.         // selected is an interenal flag
  522.         // openLocation is the function that opens the href file In a frame
  523.         //sortby will change to reflect the new sort order when a new item is added to the list.
  524.  
  525.         this.id=id;
  526.         this.title=title;
  527.         this.path=path;
  528.         this.keytype="";
  529.         this.fspath="";
  530.         this.err="";
  531.     
  532.     
  533.         this.stype="";
  534.         
  535.         if (path.indexOf("W3SVC") !=-1){
  536.             this.stype="www";
  537.         }
  538.  
  539.         if (path.indexOf("FTPSVC") !=-1){
  540.             this.stype="ftp";
  541.         }
  542.         
  543.  
  544.         this.vtype=vtype;
  545.  
  546.  
  547.         this.open=false;
  548.         this.state=state;
  549.         this.displaystate = Global.displaystate[state];
  550.         this.isApp = false;
  551.         this.isCached=false;
  552.         this.isWorkingServer=false;
  553.  
  554.         this.parent=null;
  555.         this.level=1;
  556.         this.loc="http://"+this.title;
  557.         dir="images/";
  558.  
  559.         this.icon=dir +"comp";
  560.  
  561.         this.href="blank.htm";
  562.         this.deleted=false;
  563.         this.selected=false;
  564.         this.lastChild=false;
  565.  
  566.         //methods
  567.         this.openLocation=openLocation;
  568.         this.addNode=addNode;
  569.         this.insertNode=insertNode;
  570.         this.deleteItem=deleteItem;
  571.         this.deCache=deCache;
  572.         this.browseItem=browseItem;
  573.         this.markTerms=markTerms;
  574.         this.cache=cache;
  575.         this.connect=connect;
  576.         this.sortList=sortList;
  577.         this.restricted ="";
  578.  
  579.         }
  580.  
  581.     // Create a blank array for our set data path inheritence list
  582.     inheritenceList = new Array();    
  583.  
  584.     // Fill the nodeList array with objects.
  585.     // The array items will be displayed In the id # order,
  586.     // as Jscript has limited array sorting capabilities.
  587.     // Children should always follow their parent item.
  588.     <% 
  589.  
  590.     On Error Resume Next 
  591.     Dim newid, computer, thisinstance, currentADsObj, FileSystem
  592.     Dim thisname
  593.     
  594.     computer="localhost"
  595.     thisinstance=Request.ServerVariables("INSTANCE_ID")
  596.  
  597.     if Session("isAdmin") then
  598.  
  599.          %>
  600.         //the localhost
  601.         nodeList[0]=new listObj(0,"<%= Request.ServerVariables("SERVER_NAME") %>","IIS://<%= computer %>", "comp",1);
  602.  
  603.         nodeList[0].isCached=true;    
  604.         nodeList[0].open=true;
  605.         nodeList[0].selected=true;
  606.  
  607.         <% 
  608.         newid=1
  609.  
  610.          %>//FTPSVC<% 
  611.         Set currentADsObj=GetObject("IIS://" & computer & "/MSFTPSVC") 
  612.         addInstances currentADsObj,0,"server"
  613.  
  614.          %>//W3SVC<% 
  615.         Set currentADsObj=GetObject("IIS://" & computer & "/W3SVC") 
  616.         addInstances currentADsObj,0,"server"    
  617.         
  618.     else
  619.         Set FileSystem=CreateObject("Scripting.FileSystemObject")
  620.         Set currentADsObj=GetObject("IIS://" & computer & "/W3SVC/" & thisInstance)
  621.         thisname=currentADsObj.ServerComment
  622.         if thisname="" then
  623.             thisname="[Web Site #" & currentADsObj.Name & "]"
  624.         end if
  625.          %>
  626.         //the instance
  627.         nodeList[0]=new listObj(0,"<%= thisname %>","IIS://<%= computer %>/W3SVC/<%= thisinstance %>", "server",2);
  628.         nodeList[0].isWorkingServer=false;    
  629.         nodeList[0].isCached=true;    
  630.         nodeList[0].open=true;
  631.         nodeList[0].icon="images/www";
  632.         nodeList[0].loc="http://<%= Request.ServerVariables("SERVER_NAME") %>/"; 
  633.  
  634.         <% 
  635.         newid=1
  636.  
  637.         addNodes currentADsObj,0,"vdir"
  638.     end if
  639.  
  640.     Sub addInstances(Container, parentid, vtype)
  641.         On Error Resume Next
  642.         Dim thisname, Child, thisid, thisstate
  643.         For Each Child In Container
  644.             if Instr(Child.KeyType,"Server") <> 0 then
  645.                 thisid=newid
  646.                 thisname=Child.Name
  647.                 thisstate=""
  648.                 thisname=Child.ServerComment
  649.                 if thisname="" then
  650.                     if Instr(Child.KeyType,"Ftp") <> 0 then
  651.                         thisname="[FTP Site #" & Child.Name & "]"                    
  652.                     else
  653.                         thisname="[Web Site #" & Child.Name & "]"
  654.                     end if
  655.                 end if
  656.                 thisstate=Child.ServerState                    
  657.     
  658.                 if err=0 then
  659.                     SetJscriptObj thisname, Child.ADsPath,parentid, vtype, thisstate, false, "",False
  660.                     if Child.Name=Request.ServerVariables("INSTANCE_ID") then
  661.                         if InStr(Child.ADsPath,"W3SVC") then 
  662.                             SetWorkingInstance thisid
  663.                         end if
  664.                     end if
  665.                     if Child.ClusterEnabled then
  666.                         %>
  667.                         nodeList[<%= thisid %>].restricted="<%= L_CLUSTERSERVERUI_TEXT %>";
  668.                         <%
  669.                     end if
  670.                 else
  671.                     if err = &H800401E4 or err = 70 then        
  672.                         Response.Status = "401 access denied"
  673.                     end if
  674.                 end if
  675.             end if 
  676.             'this child may have err'd but we need to enum the rest anyway, so we clear our error...
  677.             err.Clear
  678.         Next
  679.     End Sub
  680.  
  681.     Sub addNodes(Container, parentid, vtype)
  682.         On Error Resume Next    
  683.         Dim thisname, isApp, thisid, thisstate, thisroot, approot
  684.         
  685.         For Each Child In Container
  686.             if Instr(Child.KeyType, "VirtualDir") <> 0 then
  687.     
  688.                 thisid=newid
  689.                 thisname=Child.Name
  690.                 thisstate=2
  691.                 
  692.                 isApp = False
  693.                 approot=LCase(Child.AppRoot)
  694.                 if len(approot) <> 0 then
  695.                     thisroot = LCase(Child.ADsPath)
  696.                     approot = Mid(approot,Instr(approot,"w3svc/")+1)
  697.                     thisroot = Mid(thisroot,Instr(thisroot,"w3svc/")+1) & "/"        
  698.                     if thisroot=approot then
  699.                         isApp = True
  700.                     end if
  701.                 end if
  702.                 
  703.                 
  704.                 if UCase(thisname) <> "ROOT" then 
  705.     
  706.                     SetJscriptObj thisname, Child.ADsPath, parentid, vtype, thisstate, true, Child.Path, isApp
  707.     
  708.                     addNodes Child, thisid, "vdir"
  709.                     'addDirs Child.Path, Child.ADsPath, thisid, "dir"
  710.                 else
  711.     
  712.                     addNodes Child, parentid, "vdir"
  713.                     'addDirs Child.Path, Child.ADsPath, parentid, "dir"    
  714.                 end if
  715.             end if 
  716.         Next
  717.     End Sub
  718.  
  719.     Sub addDirs(path, adspath, parentid, vtype)
  720.     On Error Resume Next    
  721.     Dim thisid,thisname,thisstate,i,f, thispath
  722.  
  723.     if Instr(UCase(adspath),"W3SVC") <> 0   then     
  724.         if path <> "" then 
  725.             if Left(path,2) <> "\\" then
  726.                  If FileSystem.FolderExists(path) Then    
  727.                      Set f=FileSystem.GetFolder(path)
  728.                      For Each i In f.SubFolders
  729.                           thisid=newid
  730.                          thisstate=2
  731.                          thispath=adspath & "/" & i.Name
  732.                          SetJscriptObj i.Name,thispath, parentid, vtype, thisstate, true,i, false
  733.                           if err=0 then
  734.                              addDirs i, thispath, thisid, "dir"
  735.                          end if
  736.                     Next
  737.                  End If
  738.             end if
  739.         end if
  740.     end if
  741.  
  742.     End Sub
  743.  
  744.  
  745.     Sub SetJscriptObj(caption, path, parentid, vtype,state, cached,fspath,isApp)
  746.          %>
  747.         nodeList[<%= newid %>]=nodeList[<%= parentid %>].addNode(new top.title.listObj(<%= newid %>,"<%= sJSLiteral(caption) %>","<%= sJSLiteral(path) %>","<%= vtype %>",<%= state %>));
  748.         <% if cached then %>
  749.             nodeList[<%= newid %>].isCached=true;
  750.         <% else %>
  751.             nodeList[<%= newid %>].isCached=false;
  752.         <% end if %>
  753.         <% if isApp then %>
  754.             nodeList[<%= newid %>].icon = Global.imagedir + "app";
  755.             nodeList[<%= newid %>].isApp = true;
  756.         <% end if %>
  757.         nodeList[<%= newid %>].fspath="<%= replace(fspath,"\","\\") %>";
  758.  
  759.         <% 
  760.         newid=newid +1
  761.     End Sub
  762.     
  763.     Sub SetWorkingInstance(thisid)
  764.         %>
  765.         nodeList[<%= thisid %>].isWorkingServer=true;
  766.         <%
  767.     End Sub
  768.  %>
  769.  
  770.     markTerms();
  771.  
  772. </script>
  773.  
  774. </head>
  775.  
  776. <body Background="images/cube.gif" text="#FFFFFF" topmargin="0" leftmargin="0" onload="loadPage();" onunload="unload_popwindow();">
  777.  
  778. <table width="100%" cellpadding="0" cellspacing="0" border="0" align="LEFT">
  779.     <tr>
  780.         <td>
  781.         <IMG SRC="images/Ismhd.gif" WIDTH=189 HEIGHT=19 BORDER=0 alt="<%= L_ISM_TEXT %>" HSPACE=0 VSPACE=0>
  782.         </td>
  783.         
  784.         <td align="right" valign="middle">
  785.             <%= sFont("","","#FFFFFF",True) %>
  786.  
  787.                 <a href="http://<%= Request.ServerVariables("SERVER_NAME") %>/iishelp/iis/misc/default.asp" target="window">
  788.                     <IMG SRC="images/Doc.gif" WIDTH=16 HEIGHT=16 BORDER=0 ALT="<%= L_DOCS_TEXT %>">
  789.                 </A>
  790.                  
  791.                 <a href="javascript:helpBox();">
  792.                     <IMG SRC="images/help.gif" WIDTH=16 HEIGHT=16 BORDER=0 ALT="<%= L_HELP_TEXT %>">
  793.                 </A>
  794.             </FONT>    
  795.         </td>
  796.     </tr>
  797. </table>
  798. <form name="hiddenform">
  799.     <input type="hidden" name="slash" value="\">
  800. </form>
  801.  
  802. </body>
  803. </html>
  804.  
  805.  
  806.  
  807.